package com.yangrd.airship.upms.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.persistence.Embeddable;

/**
 * description: DictItem
 *
 * @author: yangrd
 * @date: 2021/7/3
 * @version: 1.0
 */
@Embeddable
@Data
@AllArgsConstructor(staticName = "of")
@NoArgsConstructor
@EqualsAndHashCode(of = "label")
public class DictItem implements Comparable<DictItem> {

    String label;

    String value;

    Integer sort;

    @Override
    public int compareTo(DictItem dictItem) {
        return sort.compareTo(dictItem.sort);
    }
}
